﻿//-----------------------------------------------------------------------
// <copyright file="IDal.cs" company="SLWY Enterprises">
// * Copyright (C) 2017 四川商旅无忧科技有限公司 版权所有。
// * version : 1.0
// * author  : qinchaoyue
// * FileName: IDal.cs
// * history : created by qinchaoyue 2017-10-16 03:02:04
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;

namespace Slwy.Core.Data
{
    /// <summary>
    /// The Dal interface.
    /// </summary>
    /// <typeparam name="T"> 数据库表 </typeparam>
    public interface IDal<T> where T : class
    {
        /// <summary>
        /// 增加实体
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns> 影响行数</returns>
        int Insert(T entity);

        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns> 影响行数</returns>
        int Update(T entity);

        /// <summary>
        /// 逻辑删除实体
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns> 影响行数</returns>
        int Recycle(T entity);
    }
}
